home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 6⁄29⁄90 / 0145-walking the inherita-Jun90 next >
Encoding:
Text File  |  1990-06-29  |  1.3 KB  |  38 lines  |  [TEXT/GEOL]

  1. Item    0191703                         25-June-90        14:29PDT
  2.  
  3. From:   MM.XOBJ                         MacroMind, Haim Zamir,PRT
  4.  
  5. To:     CPLUS.DEV$                      C++ Interest List--Developers
  6.  
  7. Sub:    walking the inheritance chain
  8.  
  9. Dear C++ Enthusiasts:
  10.  
  11. First of all, thanks to Messrs. Schmucker and Rosenstein for their responses to
  12. my last question on C++ global usage and vtables.
  13.  
  14. I now pose the following question:
  15.  
  16. My understanding of vtables so far is that the compiler turns all references to
  17. virtual methods into vtable indices, and that there is no inheritance chain to
  18. follow in vtables, since inherited method pointers are copied from base class
  19. vtables into derived class vtables wherever they are not overridden (preferring
  20. speed over compactness).
  21.  
  22. Is there an inheritance chain I can follow during runtime with a piece of code?
  23. I would like to attach the equivalent of dynamically assigned methods to
  24. classes, and have no problem doing this, except that I can't inherit them
  25. without a chain to follow.  It seems that instances store only a reference to
  26. the vtable, which is a dead end.
  27.  
  28. I am aware of the fact that this goes into implementation dependent country,
  29. but then again, we can't do everything we need gracefully with plain old
  30. statically declared methods attached to classes.
  31.  
  32.  
  33. Haim Zamir
  34. MacroMind, Inc.
  35. AppleLink MM.XOBJ
  36.  
  37.  
  38.